home *** CD-ROM | disk | FTP | other *** search
- /* LogEntry
- *
- * by Steve Roughton, August 1987.
- *
- * Prepends a Fido/Opus log timestamp to the command line args
- * and echoes the whole thing to the standard output. Useful
- * for making custom entries in the log. Uses the log id '$',
- * which is supposed to mean 'Sysop Entry'.
- *
- * Source compiled with Microsoft C 4.0.
- */
-
- #include <time.h>
- #include <stdio.h>
-
- char *(month [])= { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
- } ;
-
- main (argc, argv)
-
- int argc ;
- char *argv [] ;
- {
- long ltime ;
- struct tm *now ;
- int i ;
-
- time (<ime) ;
- now = localtime (<ime) ;
-
- printf ("$ %02d %s %2d:%02d:%02d ",
- now->tm_mday, month [now->tm_mon],
- now->tm_hour, now->tm_min, now->tm_sec) ;
-
- for (i=1 ; i < argc ; ++i)
- { fputs (argv [i], stdout) ;
- fputc (' ', stdout) ;
- }
-
- fputc ('\n', stdout) ;
- }
-